<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
   <meta name="description" content="string operations">
    
    <meta name="author" content="John S. Urban" >
    <link rel="icon" href="../favicon.png">

    <title>M_strings_oop.f90 &ndash; M_strings</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/pygments.css" rel="stylesheet">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/local.css" rel="stylesheet">
    
    <link  href="../tipuesearch/tipuesearch.css" rel="stylesheet">
    
    

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script src="../js/jquery-2.1.3.min.js"></script>
    <script src="../js/svg-pan-zoom.min.js"></script>

  </head>

  <body>

    <!-- Fixed navbar -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="../index.html">M_strings </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
        
            <li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
              <a href="#" class="dropdown-toggle"
              data-toggle="dropdown" role="button"
              aria-haspopup="true"
     aria-expanded="false">Contents <span class="caret"></span></a>
        <ul class="dropdown-menu">
          
              
            <li><a href="../lists/files.html">Source Files</a></li>
        
        
        
            <li><a href="../lists/modules.html">Modules</a></li>
        
            
                                
            <li><a href="../lists/procedures.html">Procedures</a></li>
        
               
            <li><a href="../lists/types.html">Derived Types</a></li>
        
        
            </ul>
            </li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/files.html">Source Files</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/modules.html">Modules</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/procedures.html">Procedures</a></li>

                             
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/types.html">Derived Types</a></li>


          </ul>
        
        <form action="../search.html" class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
        </div>
<!--
        <button type="submit" class="btn btn-default">Submit</button>
-->
        </form>
        
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container">
    
  
  <div class="row">
    <h1>M_strings_oop.f90
    <small>Source File</small>
    
    </h1>
    
<div class="row">
  <div class="col-lg-12">
<div class="well well-sm">
  <ul class="list-inline" style="margin-bottom:0px;display:inline">
     
     
     
     
    
    
     <li><i class="fa fa-list-ol"></i>
       <a data-toggle="tooltip"
    data-placement="bottom" data-html="true"
    title=" 8.8% of total for source files.">341 statements</a>
     </li> 
     
     
     
    <li><i class="fa fa-code"></i><a href="../src/M_strings_oop.f90"> Source File</a></li>
     
     
  </ul>
  <ol class="breadcrumb in-well text-right">
  
    
  
     <li class="active">M_strings_oop.f90</li>
  </ol>
</div>
</div>
</div>
<script>
  $(function () {
  $('[data-toggle="tooltip"]').tooltip()
  })
</script>

  </div>
  <div class="row">
    <div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
    
<div id="sidebar">
  
<h3>Contents</h3>
 







<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#mods-0">Modules</a></h3></div>
  <div id="mods-0" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../module/m_strings_oop.html">M_strings_oop</a>
      
    </div>
  </div>
</div>
















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../sourcefile/m_strings_oop.f90.html#src">M_strings_oop.f90</a>
  </div>
</div>



</div>

    </div>
    <div class="col-md-9" id='text'>
      
      <br>
    
      
      

    <section class="visible-xs visible-sm hidden-md">
      
<h3>Contents</h3>
 







<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#mods-1">Modules</a></h3></div>
  <div id="mods-1" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../module/m_strings_oop.html">M_strings_oop</a>
      
    </div>
  </div>
</div>
















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../sourcefile/m_strings_oop.f90.html#src">M_strings_oop.f90</a>
  </div>
</div>



    </section>
    <br class="visible-xs visible-sm hidden-md">

    <section>
      <h2><span class="anchor" id="src"></span>Source Code</h2>
    <div class="hl"><pre><span></span><a name="ln-1"></a><span class="c">!&gt;</span>
<a name="ln-2"></a><span class="c">!!##NAME</span>
<a name="ln-3"></a><span class="c">!!    M_strings_oop(3f) - [M_strings::INTRO] OOP Fortran string module</span>
<a name="ln-4"></a><span class="c">!!</span>
<a name="ln-5"></a><span class="c">!!##SYNOPSIS</span>
<a name="ln-6"></a><span class="c">!!</span>
<a name="ln-7"></a><span class="c">!!    use M_strings_oop</span>
<a name="ln-8"></a><span class="c">!!</span>
<a name="ln-9"></a><span class="c">!!##DESCRIPTION</span>
<a name="ln-10"></a><span class="c">!!    The M_strings(3fm) module is a collection of Fortran procedures</span>
<a name="ln-11"></a><span class="c">!!    that supplement the built-in intrinsic string routines. Routines</span>
<a name="ln-12"></a><span class="c">!!    for parsing, tokenizing, changing case, substituting new strings for</span>
<a name="ln-13"></a><span class="c">!!    substrings, locating strings with simple wildcard expressions, removing</span>
<a name="ln-14"></a><span class="c">!!    tabs and line terminators and other string manipulations are included.</span>
<a name="ln-15"></a><span class="c">!!</span>
<a name="ln-16"></a><span class="c">!!    M_strings_oop(3fm) is a companion module that provides an OOP interface</span>
<a name="ln-17"></a><span class="c">!!    to the M_strings module.</span>
<a name="ln-18"></a><span class="c">!!</span>
<a name="ln-19"></a><span class="c">!!</span>
<a name="ln-20"></a><span class="c">!!##SEE ALSO</span>
<a name="ln-21"></a><span class="c">!!    There are additional routines in other GPF modules for working with</span>
<a name="ln-22"></a><span class="c">!!    expressions (M_calculator), time strings (M_time), random strings</span>
<a name="ln-23"></a><span class="c">!!    (M_random, M_uuid), lists (M_list), and interfacing with the C regular</span>
<a name="ln-24"></a><span class="c">!!    expression library (M_regex).</span>
<a name="ln-25"></a><span class="c">!!</span>
<a name="ln-26"></a><span class="c">!!##EXAMPLES</span>
<a name="ln-27"></a><span class="c">!!</span>
<a name="ln-28"></a><span class="c">!!    Each of the procedural functions in M_strings(3fm) includes an example</span>
<a name="ln-29"></a><span class="c">!!    program in the corresponding man(1) page for the function. The</span>
<a name="ln-30"></a><span class="c">!!    object-oriented interface does not have individual man(1) pages,</span>
<a name="ln-31"></a><span class="c">!!    but is instead demonstrated using the following example program:</span>
<a name="ln-32"></a><span class="c">!!</span>
<a name="ln-33"></a><span class="c">!!     program demo_M_strings_oop</span>
<a name="ln-34"></a><span class="c">!!     !</span>
<a name="ln-35"></a><span class="c">!!     ! This is an example using the object-oriented class/type model</span>
<a name="ln-36"></a><span class="c">!!     ! defined in M_strings_oop</span>
<a name="ln-37"></a><span class="c">!!     ! This is essentially the same functionality as the procedures</span>
<a name="ln-38"></a><span class="c">!!     ! combined with several Fortran intrinsics and overloaded operators</span>
<a name="ln-39"></a><span class="c">!!     !</span>
<a name="ln-40"></a><span class="c">!!     use M_strings_oop,only : string, p</span>
<a name="ln-41"></a><span class="c">!!     implicit none</span>
<a name="ln-42"></a><span class="c">!!     TYPE(string) :: str1</span>
<a name="ln-43"></a><span class="c">!!     TYPE(string) :: str2</span>
<a name="ln-44"></a><span class="c">!!     TYPE(string) :: str3</span>
<a name="ln-45"></a><span class="c">!!     TYPE(string) :: str4</span>
<a name="ln-46"></a><span class="c">!!     !==============================================================================</span>
<a name="ln-47"></a><span class="c">!!       write(*,*)&#39;exercise the M_STRING_OOP module interface&#39;</span>
<a name="ln-48"></a><span class="c">!!       ! draw a break line in the output</span>
<a name="ln-49"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-50"></a><span class="c">!!       write(*,*)&#39;Call methods of type(STRING)&#39;</span>
<a name="ln-51"></a><span class="c">!!       ! define TYPE(STRING) with constructor</span>
<a name="ln-52"></a><span class="c">!!       str2=string(&#39;   This  is  a  String!       &#39;)</span>
<a name="ln-53"></a><span class="c">!!       str4=string(&#39; a  String &#39;)</span>
<a name="ln-54"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-55"></a><span class="c">!!       ! print members of type</span>
<a name="ln-56"></a><span class="c">!!       write(*,101)&#39;str2%str is ................ &#39;,str2%str</span>
<a name="ln-57"></a><span class="c">!!       ! same as intrinsic LEN()</span>
<a name="ln-58"></a><span class="c">!!       write(*,202)&#39;len ........................ &#39;,str2%len()</span>
<a name="ln-59"></a><span class="c">!!       ! same as intrinsic INDEX()</span>
<a name="ln-60"></a><span class="c">!!       write(*,202)&#39;len_trim ................... &#39;,str2%len_trim()</span>
<a name="ln-61"></a><span class="c">!!       ! same as intrinsic INDEX()</span>
<a name="ln-62"></a><span class="c">!!       write(*,202)&#39;index(&quot;is&quot;)................. &#39;,str2%index(&quot;is&quot;)</span>
<a name="ln-63"></a><span class="c">!!       ! same as intrinsic INDEX()</span>
<a name="ln-64"></a><span class="c">!!       write(*,202)&#39;index(&quot;is&quot;,back=.T.) ....... &#39;,str2%index(&quot;is&quot;,back=.TRUE.)</span>
<a name="ln-65"></a><span class="c">!!       ! output TYPE(STRING) with %str all uppercase</span>
<a name="ln-66"></a><span class="c">!!       write(*,101)&#39;upper ...................... &#39;,p(str2%upper())</span>
<a name="ln-67"></a><span class="c">!!       ! output TYPE(STRING) with %str all miniscule</span>
<a name="ln-68"></a><span class="c">!!       write(*,101)&#39;lower ...................... &#39;,p(str2%lower())</span>
<a name="ln-69"></a><span class="c">!!       ! output TYPE(STRING) with %str reversed</span>
<a name="ln-70"></a><span class="c">!!       write(*,101)&#39;reverse .................... &#39;,p(str2%reverse())</span>
<a name="ln-71"></a><span class="c">!!       ! same as intrinsic ADJUSTL()</span>
<a name="ln-72"></a><span class="c">!!       write(*,101)&#39;adjustl .................... &#39;,p(str2%adjustl())</span>
<a name="ln-73"></a><span class="c">!!       ! same as intrinsic ADJUSTR()</span>
<a name="ln-74"></a><span class="c">!!       write(*,101)&#39;adjustr .................... &#39;,p(str2%adjustr())</span>
<a name="ln-75"></a><span class="c">!!       ! center string in current string length</span>
<a name="ln-76"></a><span class="c">!!       write(*,101)&#39;adjustc .................... &#39;,p(str2%adjustc())</span>
<a name="ln-77"></a><span class="c">!!       ! center string in string length of NN</span>
<a name="ln-78"></a><span class="c">!!       write(*,101)&#39;adjustc(49) ................ &#39;,p(str2%adjustc(49))</span>
<a name="ln-79"></a><span class="c">!!       ! force %str to be NN characters long</span>
<a name="ln-80"></a><span class="c">!!       write(*,101)&#39;lenset(49) ................. &#39;,p(str2%lenset(49))</span>
<a name="ln-81"></a><span class="c">!!       ! same as intrinsic TRIM()</span>
<a name="ln-82"></a><span class="c">!!       write(*,101)&#39;trim ....................... &#39;,p(str2%trim())</span>
<a name="ln-83"></a><span class="c">!!       ! trim leading and trailing spaces</span>
<a name="ln-84"></a><span class="c">!!       write(*,101)&#39;crop ....................... &#39;,p(str2%crop())</span>
<a name="ln-85"></a><span class="c">!!       ! calls M_strings procedure SUBSTITUTE()</span>
<a name="ln-86"></a><span class="c">!!       write(*,101)&#39;substitute(&quot;This&quot;,&quot;Here&quot;) .. &#39;,p(str2%substitute(&quot;This&quot;,&quot;Here&quot;))</span>
<a name="ln-87"></a><span class="c">!!       ! calls M_strings procedure COMPACT()</span>
<a name="ln-88"></a><span class="c">!!       write(*,101)&#39;compact .................... &#39;,p(str2%compact())</span>
<a name="ln-89"></a><span class="c">!!       write(*,101)&#39;compact(&quot;&quot;) ................ &#39;,p(str2%compact(&quot;&quot;))</span>
<a name="ln-90"></a><span class="c">!!       write(*,101)&#39;compact(&quot;:&quot;) ............... &#39;,p(str2%compact(&quot;:&quot;))</span>
<a name="ln-91"></a><span class="c">!!       ! calls M_strings procedure TRANSLITERATE()</span>
<a name="ln-92"></a><span class="c">!!       write(*,101)&#39;transliterate(&quot;aei&quot;,&quot;VWX&quot;) . &#39;,p(str2%transliterate(&quot;aei&quot;,&quot;VWX&quot;))</span>
<a name="ln-93"></a><span class="c">!!       write(*,101)&#39;transliterate(&quot;aeiou&quot;,&quot; &quot;) . &#39;,p(str2%transliterate(&quot;aeiou&quot;,&quot; &quot;))</span>
<a name="ln-94"></a><span class="c">!!       write(*,101)&#39;transliterate(&quot;aeiou&quot;,&quot;&quot;) .. &#39;,p(str2%transliterate(&quot;aeiou&quot;,&quot;&quot;))</span>
<a name="ln-95"></a><span class="c">!!       write(*,101)&#39;transliterate(&quot; aeiou&quot;,&quot;&quot;) . &#39;,p(str2%transliterate(&quot; aeiou&quot;,&quot;&quot;))</span>
<a name="ln-96"></a><span class="c">!!       ! calls M_strings procedure SWITCH()</span>
<a name="ln-97"></a><span class="c">!!       write(*,404)&#39;chars .................... . &#39;,str4%chars()</span>
<a name="ln-98"></a><span class="c">!!</span>
<a name="ln-99"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-100"></a><span class="c">!!       str2%str=&#39;\t\tSome tabs\t   x\bX &#39;</span>
<a name="ln-101"></a><span class="c">!!       write(*,101)&#39;str2%str ................... &#39;,str2%str</span>
<a name="ln-102"></a><span class="c">!!       write(*,101)&#39;expand ..................... &#39;,p(str2%expand())</span>
<a name="ln-103"></a><span class="c">!!       str2=str2%expand()</span>
<a name="ln-104"></a><span class="c">!!       ! calls M_strings procedure NOTABS()</span>
<a name="ln-105"></a><span class="c">!!       write(*,101)&#39;notabs ..................... &#39;,p(str2%notabs())</span>
<a name="ln-106"></a><span class="c">!!       ! calls M_strings procedure NOESC()</span>
<a name="ln-107"></a><span class="c">!!       write(*,101)&#39;noesc ...................... &#39;,p(str2%noesc())</span>
<a name="ln-108"></a><span class="c">!!</span>
<a name="ln-109"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-110"></a><span class="c">!!       write(*,*)&#39;Casting to numeric variables&#39;</span>
<a name="ln-111"></a><span class="c">!!       str3=string(&#39;   12.345678901234567e1        &#39;)</span>
<a name="ln-112"></a><span class="c">!!       write(*,101)&#39;str3%str ................... &#39;,str3%str</span>
<a name="ln-113"></a><span class="c">!!       ! calls M_strings procedure STRING_TO_VALUE()</span>
<a name="ln-114"></a><span class="c">!!       write(*,*)&#39;int  ....................... &#39;, str3%int()</span>
<a name="ln-115"></a><span class="c">!!       ! calls M_strings procedure STRING_TO_VALUE()</span>
<a name="ln-116"></a><span class="c">!!       write(*,*)&#39;real ....................... &#39;, str3%real()</span>
<a name="ln-117"></a><span class="c">!!       ! calls M_strings procedure STRING_TO_VALUE()</span>
<a name="ln-118"></a><span class="c">!!       write(*,*)&#39;dble ....................... &#39;, str3%dble()</span>
<a name="ln-119"></a><span class="c">!!</span>
<a name="ln-120"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-121"></a><span class="c">!!       write(*,*)&#39;Matching simple globbing patterns&#39;</span>
<a name="ln-122"></a><span class="c">!!       str3=string(&#39;   12.345678901234567e1        &#39;)</span>
<a name="ln-123"></a><span class="c">!!       str3=string(&#39;Four score and seven years ago&#39;)</span>
<a name="ln-124"></a><span class="c">!!       write(*,101)&#39;str3%str ................... &#39;,str3%str</span>
<a name="ln-125"></a><span class="c">!!       ! calls M_strings procedure MATCHW</span>
<a name="ln-126"></a><span class="c">!!       write(*,*)&#39;match(&quot;Fo*&quot;) ............... &#39;, str3%match(&quot;Fo*&quot;)</span>
<a name="ln-127"></a><span class="c">!!       ! calls M_strings procedure MATCHW</span>
<a name="ln-128"></a><span class="c">!!       write(*,*)&#39;match(&quot;and&quot;) ............... &#39;, str3%match(&quot;and&quot;)</span>
<a name="ln-129"></a><span class="c">!!       ! calls M_strings procedure MATCHW</span>
<a name="ln-130"></a><span class="c">!!       write(*,*)&#39;match(&quot;*and*&quot;) ............. &#39;, str3%match(&quot;*and*&quot;)</span>
<a name="ln-131"></a><span class="c">!!</span>
<a name="ln-132"></a><span class="c">!!       101 format(1x,a,&quot;[&quot;,a,&quot;]&quot;)</span>
<a name="ln-133"></a><span class="c">!!       202 format(1x,a,i0)</span>
<a name="ln-134"></a><span class="c">!!       303 format(1x,*(l3))</span>
<a name="ln-135"></a><span class="c">!!       404 format(1x,a,*(&quot;[&quot;,a1,&quot;]&quot;:))</span>
<a name="ln-136"></a><span class="c">!!</span>
<a name="ln-137"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-138"></a><span class="c">!!       write(*,*)&#39;OVERLOADED OPERATORS (add and subtract,return TYPE(STRING))&#39;</span>
<a name="ln-139"></a><span class="c">!!       str1%str=&#39;123.456&#39;</span>
<a name="ln-140"></a><span class="c">!!       str2%str=&#39;AaBbCcDdEeFfGgHhIiJj AaBbCcDdEeFfGgHhIiJj&#39;</span>
<a name="ln-141"></a><span class="c">!!       write(*,101)&#39;str1%str ................... &#39;,str1%str</span>
<a name="ln-142"></a><span class="c">!!       write(*,101)&#39;str2%str ................... &#39;,str2%str</span>
<a name="ln-143"></a><span class="c">!!       write(*,*)&#39;str1 + str2 ................ &#39;,p(str1 + str2)</span>
<a name="ln-144"></a><span class="c">!!       ! a string that looks like a numeric value can have a value added</span>
<a name="ln-145"></a><span class="c">!!       write(*,*)&#39;str1 + 20000 ............... &#39;,p(str1 +20000)</span>
<a name="ln-146"></a><span class="c">!!       write(*,*)&#39;str1 - 20.0 ................ &#39;,p(str1 -20.0)</span>
<a name="ln-147"></a><span class="c">!!       write(*,*)&#39;str2 - &quot;Aa&quot; (removes ALL) .. &#39;,p(str2 - &#39;Aa&#39;)</span>
<a name="ln-148"></a><span class="c">!!</span>
<a name="ln-149"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-150"></a><span class="c">!!       write(*,*)&#39;OVERLOADED OPERATORS (multiply,return TYPE(STRING))&#39;</span>
<a name="ln-151"></a><span class="c">!!       str1%str=&#39;AaBbCcDdEeFfGgHhIiJj&#39;</span>
<a name="ln-152"></a><span class="c">!!       write(*,101)&#39;str1%str ................... &#39;,str1%str</span>
<a name="ln-153"></a><span class="c">!!       write(*,*)&#39;str1 * 3 ................... &#39;,p(str1 * 3)</span>
<a name="ln-154"></a><span class="c">!!</span>
<a name="ln-155"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-156"></a><span class="c">!!       write(*,*)&#39;OVERLOADED OPERATORS (//,return TYPE(STRING))&#39;</span>
<a name="ln-157"></a><span class="c">!!       str1%str=&#39;String one:&#39;</span>
<a name="ln-158"></a><span class="c">!!       str2%str=&#39;String two:&#39;</span>
<a name="ln-159"></a><span class="c">!!       write(*,101)&#39;str1%str ................... &#39;,str1%str</span>
<a name="ln-160"></a><span class="c">!!       write(*,101)&#39;str2%str ................... &#39;,str2%str</span>
<a name="ln-161"></a><span class="c">!!       write(*,*)&#39;str1 // str2 ................ &#39;,p(str1 // str2)</span>
<a name="ln-162"></a><span class="c">!!       ! numeric values are converted to strings</span>
<a name="ln-163"></a><span class="c">!!       write(*,*)&#39;str1 // 20000 ............... &#39;,p(str1 // 20000)</span>
<a name="ln-164"></a><span class="c">!!       write(*,*)&#39;str1 // 20.0 ................ &#39;,p(str1 // 20.0)</span>
<a name="ln-165"></a><span class="c">!!</span>
<a name="ln-166"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-167"></a><span class="c">!!       write(*,*)&#39;OVERLOADED OPERATORS (logical comparisons,return logical)&#39;</span>
<a name="ln-168"></a><span class="c">!!       ! NOTE: comparisons are performed on the character variable members</span>
<a name="ln-169"></a><span class="c">!!       !       of the type(string)</span>
<a name="ln-170"></a><span class="c">!!       str1%str=&#39;abcdefghij&#39;</span>
<a name="ln-171"></a><span class="c">!!       str2%str=&#39;klmnopqrst&#39;</span>
<a name="ln-172"></a><span class="c">!!       write(*,101)&#39;str1%str ................... &#39;,str1%str</span>
<a name="ln-173"></a><span class="c">!!       write(*,101)&#39;str2%str ................... &#39;,str2%str</span>
<a name="ln-174"></a><span class="c">!!       write(*,*)&#39;: EQ LT GT LE GE NE&#39;</span>
<a name="ln-175"></a><span class="c">!!       write(*,*)&#39;compare str1 to str1&#39;</span>
<a name="ln-176"></a><span class="c">!!       write(*,303)str1.eq.str1  ,str1.lt.str1  ,str1.gt.str1  ,str1.le.str1 &amp;</span>
<a name="ln-177"></a><span class="c">!!                  &amp; ,str1.ge.str1  ,str1.ne.str1</span>
<a name="ln-178"></a><span class="c">!!       write(*,*)&#39;compare str1 to str2&#39;</span>
<a name="ln-179"></a><span class="c">!!       write(*,303)str1.eq.str2  ,str1.lt.str2  ,str1.gt.str2  ,str1.le.str2 &amp;</span>
<a name="ln-180"></a><span class="c">!!                  &amp; ,str1.ge.str2  ,str1.ne.str2</span>
<a name="ln-181"></a><span class="c">!!       write(*,*)&#39;compare str2 to str1&#39;</span>
<a name="ln-182"></a><span class="c">!!       write(*,303)str2.eq.str1  ,str2.lt.str1  ,str2.gt.str1  ,str2.le.str1 &amp;</span>
<a name="ln-183"></a><span class="c">!!                  &amp; ,str2.ge.str1  ,str2.ne.str1</span>
<a name="ln-184"></a><span class="c">!!</span>
<a name="ln-185"></a><span class="c">!!       write(*,*)repeat(&#39;=&#39;,78)</span>
<a name="ln-186"></a><span class="c">!!</span>
<a name="ln-187"></a><span class="c">!!     end program demo_M_strings_oop</span>
<a name="ln-188"></a><span class="c">!!</span>
<a name="ln-189"></a><span class="c">!! Expected output</span>
<a name="ln-190"></a><span class="c">!!</span>
<a name="ln-191"></a><span class="c">!!      exercise the M_STRING_OOP module interface</span>
<a name="ln-192"></a><span class="c">!!      =============================================================================</span>
<a name="ln-193"></a><span class="c">!!      Call methods of type(STRING)</span>
<a name="ln-194"></a><span class="c">!!      =============================================================================</span>
<a name="ln-195"></a><span class="c">!!      str2%str is ................ [   This  is  a  String!             ]</span>
<a name="ln-196"></a><span class="c">!!      len ........................ 36</span>
<a name="ln-197"></a><span class="c">!!      len_trim ................... 23</span>
<a name="ln-198"></a><span class="c">!!      index(&quot;is&quot;)................. 6</span>
<a name="ln-199"></a><span class="c">!!      index(&quot;is&quot;,back=.T.) ....... 10</span>
<a name="ln-200"></a><span class="c">!!      upper ...................... [   THIS  IS  A  STRING!             ]</span>
<a name="ln-201"></a><span class="c">!!      lower ...................... [   this  is  a  string!             ]</span>
<a name="ln-202"></a><span class="c">!!      reverse .................... [             !gnirtS  a  si  sihT   ]</span>
<a name="ln-203"></a><span class="c">!!      adjustl .................... [This  is  a  String!                ]</span>
<a name="ln-204"></a><span class="c">!!      adjustr .................... [                This  is  a  String!]</span>
<a name="ln-205"></a><span class="c">!!      adjustc .................... [        This  is  a  String!        ]</span>
<a name="ln-206"></a><span class="c">!!      adjustc(49) ................ [              This  is  a  String!               ]</span>
<a name="ln-207"></a><span class="c">!!      lenset(49) ................. [   This  is  a  String!                          ]</span>
<a name="ln-208"></a><span class="c">!!      trim ....................... [   This  is  a  String!]</span>
<a name="ln-209"></a><span class="c">!!      crop ....................... [This  is  a  String!]</span>
<a name="ln-210"></a><span class="c">!!      substitute(&quot;This&quot;,&quot;Here&quot;) .. [   Here  is  a  String!             ]</span>
<a name="ln-211"></a><span class="c">!!      compact .................... [This is a String!]</span>
<a name="ln-212"></a><span class="c">!!      compact(&quot;&quot;) ................ [ThisisaString!]</span>
<a name="ln-213"></a><span class="c">!!      compact(&quot;:&quot;) ............... [This:is:a:String!]</span>
<a name="ln-214"></a><span class="c">!!      transliterate(&quot;aei&quot;,&quot;VWX&quot;) . [   ThXs  Xs  V  StrXng!             ]</span>
<a name="ln-215"></a><span class="c">!!      transliterate(&quot;aeiou&quot;,&quot; &quot;) . [   Th s   s     Str ng!             ]</span>
<a name="ln-216"></a><span class="c">!!      transliterate(&quot;aeiou&quot;,&quot;&quot;) .. [   Ths  s    Strng!                 ]</span>
<a name="ln-217"></a><span class="c">!!      transliterate(&quot; aeiou&quot;,&quot;&quot;) . [ThssStrng!                          ]</span>
<a name="ln-218"></a><span class="c">!!      chars .................... . [ ][a][ ][s][t][r][i][n][g][ ]</span>
<a name="ln-219"></a><span class="c">!!      =============================================================================</span>
<a name="ln-220"></a><span class="c">!!      str2%str ................... [\t\tSome tabs\t   x\bX ]</span>
<a name="ln-221"></a><span class="c">!!      expand ..................... [         Some tabs          x   X]</span>
<a name="ln-222"></a><span class="c">!!      notabs ..................... [                Some tabs          x    X]</span>
<a name="ln-223"></a><span class="c">!!      noesc ...................... [  Some tabs    x X]</span>
<a name="ln-224"></a><span class="c">!!      =============================================================================</span>
<a name="ln-225"></a><span class="c">!!      Casting to numeric variables</span>
<a name="ln-226"></a><span class="c">!!      str3%str ................... [   12.345678901234567e1        ]</span>
<a name="ln-227"></a><span class="c">!!      int  .......................          123</span>
<a name="ln-228"></a><span class="c">!!      real .......................    123.456787</span>
<a name="ln-229"></a><span class="c">!!      dble .......................    123.45678901234567</span>
<a name="ln-230"></a><span class="c">!!      =============================================================================</span>
<a name="ln-231"></a><span class="c">!!      Matching simple globbing patterns</span>
<a name="ln-232"></a><span class="c">!!      str3%str ................... [Four score and seven years ago]</span>
<a name="ln-233"></a><span class="c">!!      match(&quot;Fo*&quot;) ...............  T</span>
<a name="ln-234"></a><span class="c">!!      match(&quot;and&quot;) ...............  F</span>
<a name="ln-235"></a><span class="c">!!      match(&quot;*and*&quot;) .............  T</span>
<a name="ln-236"></a><span class="c">!!      ==============================================================================</span>
<a name="ln-237"></a><span class="c">!!      OVERLOADED OPERATORS (add and subtract, return TYPE(STRING))</span>
<a name="ln-238"></a><span class="c">!!      str1%str ................... [123.456]</span>
<a name="ln-239"></a><span class="c">!!      str2%str ................... [AaBbCcDdEeFfGgHhIiJj AaBbCcDdEeFfGgHhIiJj]</span>
<a name="ln-240"></a><span class="c">!!      str1 + str2 ................ 123.456 AaBbCcDdEeFfGgHhIiJj AaBbCcDdEeFfGgHhIiJj</span>
<a name="ln-241"></a><span class="c">!!      str1 + 20000 ............... 20123.455999999998</span>
<a name="ln-242"></a><span class="c">!!      str1 - 20.0 ................ -103.456</span>
<a name="ln-243"></a><span class="c">!!      str2 - &quot;Aa&quot; (removes ALL) .. BbCcDdEeFfGgHhIiJj BbCcDdEeFfGgHhIiJj</span>
<a name="ln-244"></a><span class="c">!!      =============================================================================</span>
<a name="ln-245"></a><span class="c">!!      OVERLOADED OPERATORS (multiply, return TYPE(STRING))</span>
<a name="ln-246"></a><span class="c">!!      str1%str ................... [AaBbCcDdEeFfGgHhIiJj]</span>
<a name="ln-247"></a><span class="c">!!      str1 * 3 ................... AaBbCcDdEeFfGgHhIiJjAaBbCcDdEeFfGgHhIiJjAaBbCcDdEeFfGgHhIiJj</span>
<a name="ln-248"></a><span class="c">!!      =============================================================================</span>
<a name="ln-249"></a><span class="c">!!      OVERLOADED OPERATORS (//, return TYPE(STRING))</span>
<a name="ln-250"></a><span class="c">!!      str1%str ................... [String one:]</span>
<a name="ln-251"></a><span class="c">!!      str2%str ................... [String two:]</span>
<a name="ln-252"></a><span class="c">!!      str1 // str2 ................ String one:String two:</span>
<a name="ln-253"></a><span class="c">!!      str1 // 20000 ............... String one:20000</span>
<a name="ln-254"></a><span class="c">!!      str1 // 20.0 ................ String one:20.0</span>
<a name="ln-255"></a><span class="c">!!      =============================================================================</span>
<a name="ln-256"></a><span class="c">!!      OVERLOADED OPERATORS (logical comparisons, return logical)</span>
<a name="ln-257"></a><span class="c">!!      str1%str ................... [abcdefghij]</span>
<a name="ln-258"></a><span class="c">!!      str2%str ................... [klmnopqrst]</span>
<a name="ln-259"></a><span class="c">!!      : EQ LT GT LE GE NE</span>
<a name="ln-260"></a><span class="c">!!      compare str1 to str1</span>
<a name="ln-261"></a><span class="c">!!      :  T  F  F  T  T  F</span>
<a name="ln-262"></a><span class="c">!!      compare str1 to str2</span>
<a name="ln-263"></a><span class="c">!!      :  F  T  F  T  F  T</span>
<a name="ln-264"></a><span class="c">!!      compare str2 to str1</span>
<a name="ln-265"></a><span class="c">!!      :  F  F  T  F  T  T</span>
<a name="ln-266"></a><span class="c">!!      =============================================================================</span>
<a name="ln-267"></a><span class="c">!!</span>
<a name="ln-268"></a><span class="c">!!   Expected output</span>
<a name="ln-269"></a><span class="c">!!</span>
<a name="ln-270"></a><span class="c">!!##AUTHOR</span>
<a name="ln-271"></a><span class="c">!!    John S. Urban</span>
<a name="ln-272"></a><span class="c">!!</span>
<a name="ln-273"></a><span class="c">!!##LICENSE</span>
<a name="ln-274"></a><span class="c">!!    Public Domain</span>
<a name="ln-275"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-276"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-277"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-278"></a><span class="k">module </span><span class="n">M_strings_oop</span>
<a name="ln-279"></a><span class="c">!</span>
<a name="ln-280"></a><span class="c">! Define an OOP (Object-Oriented Programming) interface for the M_strings module.</span>
<a name="ln-281"></a><span class="c">!</span>
<a name="ln-282"></a><span class="c">! Leveraging the existing procedural functions in module M_strings to do the calculations allows</span>
<a name="ln-283"></a><span class="c">! this to be a definition of a derived type ( TYPE(STRING) ) and the</span>
<a name="ln-284"></a><span class="c">! methods it supports and overloading of operators to support the new data type.</span>
<a name="ln-285"></a><span class="c">!</span>
<a name="ln-286"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">upper</span><span class="p">,</span> <span class="n">lower</span>                       <span class="c">! case</span>
<a name="ln-287"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">lenset</span><span class="p">,</span> <span class="n">atleast</span><span class="p">,</span> <span class="n">adjustc</span><span class="p">,</span> <span class="n">compact</span><span class="p">,</span> <span class="n">crop</span>     <span class="c">! whitespace</span>
<a name="ln-288"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">reverse</span>
<a name="ln-289"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">notabs</span><span class="p">,</span> <span class="n">noesc</span><span class="p">,</span> <span class="n">expand</span>
<a name="ln-290"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">substitute</span><span class="p">,</span> <span class="n">transliterate</span>
<a name="ln-291"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">string_to_value</span><span class="p">,</span> <span class="n">switch</span><span class="p">,</span> <span class="n">v2s</span><span class="p">,</span> <span class="n">s2v</span>
<a name="ln-292"></a><span class="k">use </span><span class="n">M_strings</span><span class="p">,</span> <span class="k">only</span> <span class="p">:</span> <span class="n">switch</span><span class="p">,</span> <span class="n">split</span><span class="p">,</span> <span class="n">matchw</span>
<a name="ln-293"></a><span class="k">implicit none</span>
<a name="ln-294"></a><span class="k">private</span>
<a name="ln-295"></a><span class="kt">integer</span><span class="p">,</span><span class="k">parameter</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">dp</span><span class="o">=</span><span class="nb">kind</span><span class="p">(</span><span class="mf">0.0d0</span><span class="p">)</span>
<a name="ln-296"></a><span class="k">public </span><span class="n">p</span>
<a name="ln-297"></a><span class="c">!-----------------------------------------------------------------------------------------------------------------------------------</span>
<a name="ln-298"></a>   <span class="k">public </span><span class="n">string</span>
<a name="ln-299"></a><span class="c">!-----------------------------------------------------------------------------------------------------------------------------------</span>
<a name="ln-300"></a><span class="c">!DERIVED TYPE STRING</span>
<a name="ln-301"></a><span class="c">!</span>
<a name="ln-302"></a><span class="k">type </span><span class="n">string</span>
<a name="ln-303"></a>   <span class="c">! COMPONENTS:</span>
<a name="ln-304"></a>   <span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="k">allocatable</span> <span class="kd">::</span> <span class="n">str</span>
<a name="ln-305"></a><span class="k">contains</span>
<a name="ln-306"></a>   <span class="c">! METHODS:</span>
<a name="ln-307"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">adjustc</span>        <span class="o">=&gt;</span>  <span class="n">oop_adjustc</span>
<a name="ln-308"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">adjustl</span>        <span class="o">=&gt;</span>  <span class="n">oop_adjustl</span>
<a name="ln-309"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">adjustr</span>        <span class="o">=&gt;</span>  <span class="n">oop_adjustr</span>
<a name="ln-310"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">compact</span>        <span class="o">=&gt;</span>  <span class="n">oop_compact</span>
<a name="ln-311"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">crop</span>           <span class="o">=&gt;</span>  <span class="n">oop_crop</span>
<a name="ln-312"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">dble</span>           <span class="o">=&gt;</span>  <span class="n">oop_dble</span>
<a name="ln-313"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">expand</span>         <span class="o">=&gt;</span>  <span class="n">oop_expand</span>
<a name="ln-314"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">index</span>          <span class="o">=&gt;</span>  <span class="n">oop_index</span>
<a name="ln-315"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">init</span>           <span class="o">=&gt;</span>  <span class="n">init_string</span>
<a name="ln-316"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">int</span>            <span class="o">=&gt;</span>  <span class="n">oop_int</span>
<a name="ln-317"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">len</span>            <span class="o">=&gt;</span>  <span class="n">oop_len</span>
<a name="ln-318"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">len_trim</span>       <span class="o">=&gt;</span>  <span class="n">oop_len_trim</span>
<a name="ln-319"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">lenset</span>         <span class="o">=&gt;</span>  <span class="n">oop_lenset</span>
<a name="ln-320"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">atleast</span>        <span class="o">=&gt;</span>  <span class="n">oop_atleast</span>
<a name="ln-321"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">match</span>          <span class="o">=&gt;</span>  <span class="n">oop_matchw</span>
<a name="ln-322"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">lower</span>          <span class="o">=&gt;</span>  <span class="n">oop_lower</span>
<a name="ln-323"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">noesc</span>          <span class="o">=&gt;</span>  <span class="n">oop_noesc</span>
<a name="ln-324"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">notabs</span>         <span class="o">=&gt;</span>  <span class="n">oop_notabs</span>
<a name="ln-325"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="kt">real</span>           <span class="o">=&gt;</span>  <span class="n">oop_real</span>
<a name="ln-326"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">reverse</span>        <span class="o">=&gt;</span>  <span class="n">oop_reverse</span>
<a name="ln-327"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">substitute</span>     <span class="o">=&gt;</span>  <span class="n">oop_substitute</span>
<a name="ln-328"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">transliterate</span>  <span class="o">=&gt;</span>  <span class="n">oop_transliterate</span>
<a name="ln-329"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="nb">trim</span>           <span class="o">=&gt;</span>  <span class="n">oop_trim</span>
<a name="ln-330"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">upper</span>          <span class="o">=&gt;</span>  <span class="n">oop_upper</span>
<a name="ln-331"></a>   <span class="k">procedure</span>  <span class="kd">::</span>  <span class="n">chars</span>          <span class="o">=&gt;</span>  <span class="n">oop_switch</span>
<a name="ln-332"></a><span class="c">!-!   procedure  ::  split          =&gt;  oop_split</span>
<a name="ln-333"></a>   <span class="c">!DECLARATION OF OVERLOADED OPERATORS FOR TYPE(STRING)</span>
<a name="ln-334"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">eq</span>
<a name="ln-335"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">==</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">eq</span>
<a name="ln-336"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">lt</span>
<a name="ln-337"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">&lt;</span><span class="p">)</span>  <span class="o">=&gt;</span> <span class="n">lt</span>
<a name="ln-338"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">gt</span>
<a name="ln-339"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">&gt;</span><span class="p">)</span>  <span class="o">=&gt;</span> <span class="n">gt</span>
<a name="ln-340"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">ge</span>
<a name="ln-341"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">&gt;=</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">ge</span>
<a name="ln-342"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">le</span>
<a name="ln-343"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">&lt;=</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">le</span>
<a name="ln-344"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">ne</span>
<a name="ln-345"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">/=</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">ne</span>
<a name="ln-346"></a>
<a name="ln-347"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">string_plus_value</span>
<a name="ln-348"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">+</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">string_plus_value</span>   <span class="c">! string + integer|real|doubleprecision|string|character</span>
<a name="ln-349"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">string_minus_value</span>
<a name="ln-350"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">-</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">string_minus_value</span>  <span class="c">! string - integer|real|doubleprecision|string|character</span>
<a name="ln-351"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">string_multiply_value</span>
<a name="ln-352"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">*</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">string_multiply_value</span>  <span class="c">! string * integer|real|doubleprecision</span>
<a name="ln-353"></a>   <span class="k">procedure</span><span class="p">,</span><span class="k">private</span> <span class="kd">::</span> <span class="n">string_append_value</span>
<a name="ln-354"></a>   <span class="k">generic</span>           <span class="kd">::</span> <span class="n">operator</span><span class="p">(</span><span class="o">//</span><span class="p">)</span> <span class="o">=&gt;</span> <span class="n">string_append_value</span>
<a name="ln-355"></a>
<a name="ln-356"></a><span class="c">!-!   procedure,private :: minus_string</span>
<a name="ln-357"></a><span class="c">!-!   generic           :: operator(-)  =&gt; minus_string</span>
<a name="ln-358"></a><span class="k">end type</span>
<a name="ln-359"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-360"></a><span class="c">! User-defined constructors are created by defining a generic interface</span>
<a name="ln-361"></a><span class="c">! with the same name as the derived type they&#39;re supposed to construct.</span>
<a name="ln-362"></a><span class="k">interface </span><span class="n">string</span>
<a name="ln-363"></a>   <span class="k">module procedure </span><span class="n">construct_from_fill</span>
<a name="ln-364"></a><span class="k">end interface </span><span class="n">string</span>
<a name="ln-365"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-366"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-367"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-368"></a><span class="k">contains</span>
<a name="ln-369"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-370"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-371"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-372"></a><span class="c">! this function is used internally in the module, but is also declared to be a constructor for creating TYPE(DATE_TYPE) structures</span>
<a name="ln-373"></a><span class="c">!</span>
<a name="ln-374"></a><span class="k">function </span><span class="n">construct_from_fill</span><span class="p">(</span><span class="n">chars</span><span class="p">,</span><span class="nb">len</span><span class="p">)</span>
<a name="ln-375"></a>
<a name="ln-376"></a><span class="c">! ident_1=&quot;@(#)M_strings::construct_from_fill(3f): construct TYPE(STRING)&quot;</span>
<a name="ln-377"></a>
<a name="ln-378"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span> <span class="kd">::</span> <span class="n">chars</span>
<a name="ln-379"></a><span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span>          <span class="kd">::</span> <span class="nb">len</span>
<a name="ln-380"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                         <span class="kd">::</span> <span class="n">construct_from_fill</span>
<a name="ln-381"></a>   <span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">chars</span><span class="p">))</span><span class="k">then</span>
<a name="ln-382"></a><span class="k">      </span><span class="n">construct_from_fill</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">chars</span>
<a name="ln-383"></a>   <span class="k">else</span>
<a name="ln-384"></a><span class="k">      </span><span class="n">construct_from_fill</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="s1">&#39;&#39;</span>
<a name="ln-385"></a>   <span class="k">endif</span>
<a name="ln-386"></a><span class="k">   if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="nb">len</span><span class="p">))</span><span class="k">then</span>
<a name="ln-387"></a><span class="k">      </span><span class="n">construct_from_fill</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">lenset</span><span class="p">(</span><span class="n">construct_from_fill</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="nb">len</span><span class="p">)</span>
<a name="ln-388"></a>   <span class="k">endif</span>
<a name="ln-389"></a><span class="k">end function </span><span class="n">construct_from_fill</span>
<a name="ln-390"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-391"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-392"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-393"></a><span class="c">! DEFINE THE METHODS FOR THE TYPE</span>
<a name="ln-394"></a><span class="c">! These functions are privately used to define the methods that TYPE(STRING) will support</span>
<a name="ln-395"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-396"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-397"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-398"></a><span class="k">function </span><span class="n">oop_len</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">length</span><span class="p">)</span>
<a name="ln-399"></a>
<a name="ln-400"></a><span class="c">! ident_2=&quot;@(#)M_strings::oop_len(3f): length of string&quot;</span>
<a name="ln-401"></a>
<a name="ln-402"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>    <span class="kd">::</span> <span class="n">self</span>
<a name="ln-403"></a><span class="kt">integer</span>                     <span class="kd">::</span> <span class="n">length</span>
<a name="ln-404"></a>   <span class="n">length</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-405"></a><span class="k">end function </span><span class="n">oop_len</span>
<a name="ln-406"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-407"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-408"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-409"></a><span class="k">function </span><span class="n">oop_len_trim</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">length</span><span class="p">)</span>
<a name="ln-410"></a>
<a name="ln-411"></a><span class="c">! ident_3=&quot;@(#)M_strings::oop_len_trim(3f): trimmed length of string&quot;</span>
<a name="ln-412"></a>
<a name="ln-413"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>    <span class="kd">::</span> <span class="n">self</span>
<a name="ln-414"></a><span class="kt">integer</span>                     <span class="kd">::</span> <span class="n">length</span>
<a name="ln-415"></a>   <span class="n">length</span><span class="o">=</span><span class="nb">len_trim</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-416"></a><span class="k">end function </span><span class="n">oop_len_trim</span>
<a name="ln-417"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-418"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-419"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-420"></a><span class="k">function </span><span class="n">oop_switch</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="k">array</span><span class="p">)</span>
<a name="ln-421"></a>
<a name="ln-422"></a><span class="c">! ident_4=&quot;@(#)M_strings::oop_switch(3f): convert string to array of single characters&quot;</span>
<a name="ln-423"></a>
<a name="ln-424"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>    <span class="kd">::</span> <span class="n">self</span>
<a name="ln-425"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>            <span class="kd">::</span> <span class="k">array</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>
<a name="ln-426"></a>   <span class="k">array</span><span class="o">=</span><span class="n">switch</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-427"></a><span class="k">end function </span><span class="n">oop_switch</span>
<a name="ln-428"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-429"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-430"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-431"></a><span class="k">function </span><span class="n">oop_index</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">substring</span><span class="p">,</span><span class="n">back</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">location</span><span class="p">)</span>
<a name="ln-432"></a>
<a name="ln-433"></a><span class="c">! ident_5=&quot;@(#)M_strings::oop_index(3f): find starting position of a substring in a string&quot;</span>
<a name="ln-434"></a>
<a name="ln-435"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>    <span class="kd">::</span> <span class="n">self</span>
<a name="ln-436"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">substring</span>
<a name="ln-437"></a><span class="kt">integer</span>                     <span class="kd">::</span> <span class="n">location</span>
<a name="ln-438"></a><span class="kt">logical</span><span class="p">,</span><span class="k">optional</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">back</span>
<a name="ln-439"></a>   <span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">back</span><span class="p">))</span><span class="k">then</span>
<a name="ln-440"></a><span class="k">      </span><span class="n">location</span><span class="o">=</span><span class="nb">index</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">substring</span><span class="p">,</span><span class="n">back</span><span class="p">)</span>
<a name="ln-441"></a>   <span class="k">else</span>
<a name="ln-442"></a><span class="k">      </span><span class="n">location</span><span class="o">=</span><span class="nb">index</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">substring</span><span class="p">)</span>
<a name="ln-443"></a>   <span class="k">endif</span>
<a name="ln-444"></a><span class="k">end function </span><span class="n">oop_index</span>
<a name="ln-445"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-446"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-447"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-448"></a><span class="k">function </span><span class="n">oop_upper</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-449"></a>
<a name="ln-450"></a><span class="c">! ident_6=&quot;@(#)M_strings::oop_upper(3f): convert string to uppercase&quot;</span>
<a name="ln-451"></a>
<a name="ln-452"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-453"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-454"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">upper</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-455"></a><span class="k">end function </span><span class="n">oop_upper</span>
<a name="ln-456"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-457"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-458"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-459"></a><span class="k">function </span><span class="n">oop_lower</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-460"></a>
<a name="ln-461"></a><span class="c">! ident_7=&quot;@(#)M_strings::oop_lower(3f): convert string to miniscule&quot;</span>
<a name="ln-462"></a>
<a name="ln-463"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-464"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-465"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">lower</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-466"></a><span class="k">end function </span><span class="n">oop_lower</span>
<a name="ln-467"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-468"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-469"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-470"></a><span class="k">function </span><span class="n">oop_expand</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">escape_char</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-471"></a>
<a name="ln-472"></a><span class="c">! ident_8=&quot;@(#)M_strings::oop_expand(3f): expand common escape sequences by calling expand(3f)&quot;</span>
<a name="ln-473"></a>
<a name="ln-474"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>      <span class="kd">::</span> <span class="n">self</span>
<a name="ln-475"></a><span class="kt">character</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span> <span class="kd">::</span> <span class="n">escape_char</span>
<a name="ln-476"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                  <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-477"></a>   <span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">escape_char</span><span class="p">))</span><span class="k">then</span>
<a name="ln-478"></a><span class="k">      </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">expand</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">escape_char</span><span class="p">)</span>
<a name="ln-479"></a>   <span class="k">else</span>
<a name="ln-480"></a><span class="k">      </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">expand</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-481"></a>   <span class="k">endif</span>
<a name="ln-482"></a><span class="k">end function </span><span class="n">oop_expand</span>
<a name="ln-483"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-484"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-485"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-486"></a><span class="k">function </span><span class="n">oop_trim</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-487"></a>
<a name="ln-488"></a><span class="c">! ident_9=&quot;@(#)M_strings::oop_trim(3f): trim trailing spaces&quot;</span>
<a name="ln-489"></a>
<a name="ln-490"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-491"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-492"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">trim</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-493"></a><span class="k">end function </span><span class="n">oop_trim</span>
<a name="ln-494"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-495"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-496"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-497"></a><span class="k">function </span><span class="n">oop_crop</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-498"></a>
<a name="ln-499"></a><span class="c">! ident_10=&quot;@(#)M_strings::oop_crop(3f): crop leading and trailing spaces&quot;</span>
<a name="ln-500"></a>
<a name="ln-501"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-502"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-503"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">crop</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-504"></a><span class="k">end function </span><span class="n">oop_crop</span>
<a name="ln-505"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-506"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-507"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-508"></a><span class="k">function </span><span class="n">oop_reverse</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-509"></a>
<a name="ln-510"></a><span class="c">! ident_11=&quot;@(#)M_strings::oop_reverse(3f): reverse string&quot;</span>
<a name="ln-511"></a>
<a name="ln-512"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-513"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-514"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">reverse</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-515"></a><span class="k">end function </span><span class="n">oop_reverse</span>
<a name="ln-516"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-517"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-518"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-519"></a><span class="k">function </span><span class="n">oop_adjustl</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-520"></a>
<a name="ln-521"></a><span class="c">! ident_12=&quot;@(#)M_strings::oop_adjustl(3f): adjust string to left&quot;</span>
<a name="ln-522"></a>
<a name="ln-523"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-524"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-525"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">adjustl</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-526"></a><span class="k">end function </span><span class="n">oop_adjustl</span>
<a name="ln-527"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-528"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-529"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-530"></a><span class="k">function </span><span class="n">oop_adjustr</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-531"></a>
<a name="ln-532"></a><span class="c">! ident_13=&quot;@(#)M_strings::oop_adjustr(3f): adjust string to right&quot;</span>
<a name="ln-533"></a>
<a name="ln-534"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-535"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-536"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">adjustr</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-537"></a><span class="k">end function </span><span class="n">oop_adjustr</span>
<a name="ln-538"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-539"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-540"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-541"></a><span class="k">function </span><span class="n">oop_adjustc</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">length</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-542"></a>
<a name="ln-543"></a><span class="c">! ident_14=&quot;@(#)M_strings::oop_adjustc(3f): adjust string to center&quot;</span>
<a name="ln-544"></a>
<a name="ln-545"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-546"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-547"></a><span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">),</span><span class="k">optional</span>  <span class="kd">::</span> <span class="n">length</span>
<a name="ln-548"></a>   <span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">length</span><span class="p">))</span><span class="k">then</span>
<a name="ln-549"></a><span class="k">      </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">lenset</span><span class="p">(</span><span class="n">adjustc</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">length</span><span class="p">),</span><span class="n">length</span><span class="p">)</span>
<a name="ln-550"></a>   <span class="k">else</span>
<a name="ln-551"></a><span class="k">      </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">adjustc</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-552"></a>   <span class="k">endif</span>
<a name="ln-553"></a><span class="k">end function </span><span class="n">oop_adjustc</span>
<a name="ln-554"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-555"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-556"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-557"></a><span class="k">function </span><span class="n">oop_int</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-558"></a>
<a name="ln-559"></a><span class="c">! ident_15=&quot;@(#)M_strings::oop_int(3f): string to integer&quot;</span>
<a name="ln-560"></a>
<a name="ln-561"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-562"></a><span class="kt">integer</span>                      <span class="kd">::</span> <span class="k">value</span>
<a name="ln-563"></a><span class="kt">integer</span>                      <span class="kd">::</span> <span class="n">ierr</span>
<a name="ln-564"></a>   <span class="k">call </span><span class="n">string_to_value</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="k">value</span><span class="p">,</span><span class="n">ierr</span><span class="p">)</span>
<a name="ln-565"></a><span class="k">end function </span><span class="n">oop_int</span>
<a name="ln-566"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-567"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-568"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-569"></a><span class="k">function </span><span class="n">oop_real</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-570"></a>
<a name="ln-571"></a><span class="c">! ident_16=&quot;@(#)M_strings::oop_real(3f): string to real&quot;</span>
<a name="ln-572"></a>
<a name="ln-573"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-574"></a><span class="kt">real</span>                         <span class="kd">::</span> <span class="k">value</span>
<a name="ln-575"></a><span class="kt">integer</span>                      <span class="kd">::</span> <span class="n">ierr</span>
<a name="ln-576"></a>   <span class="k">call </span><span class="n">string_to_value</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="k">value</span><span class="p">,</span><span class="n">ierr</span><span class="p">)</span>
<a name="ln-577"></a><span class="k">end function </span><span class="n">oop_real</span>
<a name="ln-578"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-579"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-580"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-581"></a><span class="k">function </span><span class="n">oop_dble</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-582"></a>
<a name="ln-583"></a><span class="c">! ident_17=&quot;@(#)M_strings::oop_dble(3f): string to double&quot;</span>
<a name="ln-584"></a>
<a name="ln-585"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-586"></a><span class="n">doubleprecision</span>              <span class="kd">::</span> <span class="k">value</span>
<a name="ln-587"></a><span class="kt">integer</span>                      <span class="kd">::</span> <span class="n">ierr</span>
<a name="ln-588"></a>   <span class="k">call </span><span class="n">string_to_value</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="k">value</span><span class="p">,</span><span class="n">ierr</span><span class="p">)</span>
<a name="ln-589"></a><span class="k">end function </span><span class="n">oop_dble</span>
<a name="ln-590"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-591"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-592"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-593"></a><span class="k">function </span><span class="n">oop_compact</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="nb">char</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-594"></a>
<a name="ln-595"></a><span class="c">! ident_18=&quot;@(#)M_strings::oop_compact(3f): adjust string to center&quot;</span>
<a name="ln-596"></a>
<a name="ln-597"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-598"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-599"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">optional</span>    <span class="kd">::</span> <span class="nb">char</span>
<a name="ln-600"></a><span class="nb">   </span><span class="k">if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="nb">char</span><span class="p">))</span><span class="k">then</span>
<a name="ln-601"></a><span class="k">      </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">compact</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="nb">char</span><span class="p">)</span>
<a name="ln-602"></a>   <span class="k">else</span>
<a name="ln-603"></a><span class="k">      </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">compact</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-604"></a>   <span class="k">endif</span>
<a name="ln-605"></a><span class="k">   </span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">trim</span><span class="p">(</span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-606"></a><span class="k">end function </span><span class="n">oop_compact</span>
<a name="ln-607"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-608"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-609"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-610"></a><span class="k">function </span><span class="n">oop_substitute</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">old</span><span class="p">,</span><span class="n">new</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-611"></a>
<a name="ln-612"></a><span class="c">! ident_19=&quot;@(#)M_strings::oop_substitute(3f): change all occurrences of oldstring to newstring non-recursively&quot;</span>
<a name="ln-613"></a>
<a name="ln-614"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-615"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-616"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">old</span>
<a name="ln-617"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">new</span>
<a name="ln-618"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span>
<a name="ln-619"></a>   <span class="k">call </span><span class="n">substitute</span><span class="p">(</span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">old</span><span class="p">,</span><span class="n">new</span><span class="p">)</span>
<a name="ln-620"></a><span class="k">end function </span><span class="n">oop_substitute</span>
<a name="ln-621"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-622"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-623"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-624"></a><span class="k">function </span><span class="n">oop_transliterate</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">old</span><span class="p">,</span><span class="n">new</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-625"></a>
<a name="ln-626"></a><span class="c">! ident_20=&quot;@(#)M_strings::oop_transliterate(3f): change all occurrences of oldstring to newstring non-recursively&quot;</span>
<a name="ln-627"></a>
<a name="ln-628"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-629"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-630"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">old</span>
<a name="ln-631"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">new</span>
<a name="ln-632"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">transliterate</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">old</span><span class="p">,</span><span class="n">new</span><span class="p">)</span>
<a name="ln-633"></a><span class="k">end function </span><span class="n">oop_transliterate</span>
<a name="ln-634"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-635"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-636"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-637"></a><span class="k">function </span><span class="n">oop_atleast</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">length</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-638"></a>
<a name="ln-639"></a><span class="c">! ident_21=&quot;@(#)M_strings::oop_atleast(3f): set string to at least specified length&quot;</span>
<a name="ln-640"></a>
<a name="ln-641"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-642"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-643"></a><span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="n">length</span>
<a name="ln-644"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">atleast</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">length</span><span class="p">)</span>
<a name="ln-645"></a><span class="k">end function </span><span class="n">oop_atleast</span>
<a name="ln-646"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-647"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-648"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-649"></a><span class="k">function </span><span class="n">oop_lenset</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">length</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-650"></a>
<a name="ln-651"></a><span class="c">! ident_22=&quot;@(#)M_strings::oop_lenset(3f): set string to specific length&quot;</span>
<a name="ln-652"></a>
<a name="ln-653"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-654"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-655"></a><span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="n">length</span>
<a name="ln-656"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">lenset</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">length</span><span class="p">)</span>
<a name="ln-657"></a><span class="k">end function </span><span class="n">oop_lenset</span>
<a name="ln-658"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-659"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-660"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-661"></a><span class="k">function </span><span class="n">oop_matchw</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">pattern</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">answer</span><span class="p">)</span>
<a name="ln-662"></a>
<a name="ln-663"></a><span class="c">! ident_23=&quot;@(#)M_strings::oop_matchw(3f): test if wildcard pattern matches string&quot;</span>
<a name="ln-664"></a>
<a name="ln-665"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-666"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">pattern</span>
<a name="ln-667"></a><span class="kt">logical</span>                      <span class="kd">::</span> <span class="n">answer</span>
<a name="ln-668"></a>   <span class="n">answer</span><span class="o">=</span><span class="n">matchw</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">pattern</span><span class="p">)</span>
<a name="ln-669"></a><span class="k">end function </span><span class="n">oop_matchw</span>
<a name="ln-670"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-671"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-672"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-673"></a><span class="k">function </span><span class="n">oop_notabs</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-674"></a>
<a name="ln-675"></a><span class="c">! ident_24=&quot;@(#)M_strings::oop_notabs(3f): expand tab characters assuming tab stops every eight(8) characters&quot;</span>
<a name="ln-676"></a>
<a name="ln-677"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-678"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-679"></a><span class="kt">integer</span>                      <span class="kd">::</span> <span class="n">length</span>
<a name="ln-680"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">lenset</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">,</span><span class="mi">8</span><span class="o">*</span><span class="nb">len</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span> <span class="c">! make long enough assuming all tab characters</span>
<a name="ln-681"></a>   <span class="k">call </span><span class="n">notabs</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="n">length</span><span class="p">)</span>
<a name="ln-682"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">trim</span><span class="p">(</span><span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-683"></a><span class="k">end function </span><span class="n">oop_notabs</span>
<a name="ln-684"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-685"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-686"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-687"></a><span class="k">function </span><span class="n">oop_noesc</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-688"></a>
<a name="ln-689"></a><span class="c">! ident_25=&quot;@(#)M_strings::oop_noesc(3f): replace non-printable characters with spaces&quot;</span>
<a name="ln-690"></a>
<a name="ln-691"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-692"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                 <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-693"></a>   <span class="n">string_out</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">noesc</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">)</span>
<a name="ln-694"></a><span class="k">end function </span><span class="n">oop_noesc</span>
<a name="ln-695"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-696"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-697"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-698"></a><span class="k">function </span><span class="n">p</span><span class="p">(</span><span class="n">self</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">string_out</span><span class="p">)</span>
<a name="ln-699"></a>
<a name="ln-700"></a><span class="c">! ident_26=&quot;@(#)M_strings::oop_p(3f): return CHARACTER string from TYPE(STRING)&quot;</span>
<a name="ln-701"></a>
<a name="ln-702"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>     <span class="kd">::</span> <span class="n">self</span>
<a name="ln-703"></a><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span> <span class="kd">::</span> <span class="n">string_out</span>
<a name="ln-704"></a>   <span class="n">string_out</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span>
<a name="ln-705"></a><span class="k">end function </span><span class="n">p</span>
<a name="ln-706"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-707"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-708"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-709"></a><span class="k">subroutine </span><span class="n">init_string</span><span class="p">(</span><span class="n">self</span><span class="p">)</span>
<a name="ln-710"></a><span class="c">!</span>
<a name="ln-711"></a><span class="c">! allow for TYPE(STRING) object to be initialized.</span>
<a name="ln-712"></a><span class="c">!</span>
<a name="ln-713"></a>
<a name="ln-714"></a><span class="c">! ident_27=&quot;@(#)M_strings::init_dt(3f): initialize TYPE(STRING)&quot;</span>
<a name="ln-715"></a>
<a name="ln-716"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                        <span class="kd">::</span> <span class="n">self</span>
<a name="ln-717"></a>   <span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="s1">&#39;&#39;</span>
<a name="ln-718"></a><span class="k">end subroutine </span><span class="n">init_string</span>
<a name="ln-719"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-720"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-721"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-722"></a><span class="c">! FUNCTIONS FOR DEFINING OVERLOADED OPERATORS</span>
<a name="ln-723"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-724"></a><span class="k">function </span><span class="n">string_plus_value</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="k">value</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">other</span><span class="p">)</span>
<a name="ln-725"></a>
<a name="ln-726"></a><span class="c">! ident_28=&quot;@(#)M_strings::string_plus_value(3f): add value to TYPE(STRING)&quot;</span>
<a name="ln-727"></a>
<a name="ln-728"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>      <span class="kd">::</span> <span class="n">self</span>
<a name="ln-729"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-730"></a><span class="k">class</span><span class="p">(</span><span class="o">*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="k">value</span>
<a name="ln-731"></a><span class="c">!  This function is primarily intended to provide behaviors for the &quot;+&quot; operator for TYPE(STRING) values</span>
<a name="ln-732"></a><span class="c">!  Notice that the value can be any of several types ( INTEGER,REAL,DOUBLEPRECISION,CHARACTER,TYPE(STRING) )</span>
<a name="ln-733"></a>   <span class="k">select type</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-734"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">integer</span><span class="p">);</span>          <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="o">+</span><span class="n">s2v</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>  <span class="c">! convert string%str to integer, add to value</span>
<a name="ln-735"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">real</span><span class="p">);</span>             <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="o">+</span><span class="n">s2v</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>  <span class="c">! convert string%str to real, add to value</span>
<a name="ln-736"></a>   <span class="k">type is</span> <span class="p">(</span><span class="n">doubleprecision</span><span class="p">);</span>  <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="o">+</span><span class="n">s2v</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>  <span class="c">! convert string%str to doubleprecision, add to value</span>
<a name="ln-737"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">));</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="s1">&#39; &#39;</span><span class="o">//</span><span class="k">value</span>      <span class="c">! append space and CHARACTER to string %str</span>
<a name="ln-738"></a>   <span class="k">type is</span> <span class="p">(</span><span class="n">string</span><span class="p">);</span>           <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="s1">&#39; &#39;</span><span class="o">//</span><span class="k">value</span><span class="p">%</span><span class="n">str</span>  <span class="c">! append string %str values with space between</span>
<a name="ln-739"></a>   <span class="k">end select</span>
<a name="ln-740"></a><span class="k">end function </span><span class="n">string_plus_value</span>
<a name="ln-741"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-742"></a><span class="k">function </span><span class="n">string_minus_value</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="k">value</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">other</span><span class="p">)</span>
<a name="ln-743"></a>
<a name="ln-744"></a><span class="c">! ident_29=&quot;@(#)M_strings::string_minus_value(3f): subtract value from TYPE(STRING)&quot;</span>
<a name="ln-745"></a>
<a name="ln-746"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>      <span class="kd">::</span> <span class="n">self</span>
<a name="ln-747"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-748"></a><span class="k">class</span><span class="p">(</span><span class="o">*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="k">value</span>
<a name="ln-749"></a><span class="c">!  This function is primarily intended to provide behaviors for the &quot;-&quot; operator for TYPE(STRING) values</span>
<a name="ln-750"></a><span class="c">!  Notice that the value can be any of several types ( INTEGER,REAL,DOUBLEPRECISION,CHARACTER,TYPE(STRING) )</span>
<a name="ln-751"></a>   <span class="k">select type</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-752"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">integer</span><span class="p">);</span>         <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="o">-</span><span class="n">s2v</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>
<a name="ln-753"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">real</span><span class="p">);</span>            <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="o">-</span><span class="n">s2v</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>
<a name="ln-754"></a>   <span class="k">type is</span> <span class="p">(</span><span class="n">doubleprecision</span><span class="p">);</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="o">-</span><span class="n">s2v</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">))</span>
<a name="ln-755"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">))</span>
<a name="ln-756"></a>      <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span>
<a name="ln-757"></a>      <span class="k">call </span><span class="n">substitute</span><span class="p">(</span><span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="k">value</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<a name="ln-758"></a>   <span class="k">type is</span> <span class="p">(</span><span class="n">string</span><span class="p">)</span>
<a name="ln-759"></a>      <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span>
<a name="ln-760"></a>      <span class="k">call </span><span class="n">substitute</span><span class="p">(</span><span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="k">value</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<a name="ln-761"></a>   <span class="k">end select</span>
<a name="ln-762"></a><span class="k">end function </span><span class="n">string_minus_value</span>
<a name="ln-763"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-764"></a><span class="k">function </span><span class="n">string_append_value</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="k">value</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">other</span><span class="p">)</span>
<a name="ln-765"></a>
<a name="ln-766"></a><span class="c">! ident_30=&quot;@(#)M_strings::string_append_value(3f): append value to TYPE(STRING)&quot;</span>
<a name="ln-767"></a>
<a name="ln-768"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>      <span class="kd">::</span> <span class="n">self</span>
<a name="ln-769"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-770"></a><span class="k">class</span><span class="p">(</span><span class="o">*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="k">value</span>
<a name="ln-771"></a><span class="c">!  This function is primarily intended to provide behaviors for the &quot;//&quot; operator for TYPE(STRING) values</span>
<a name="ln-772"></a><span class="c">!  Notice that the value can be any of several types ( INTEGER,REAL,DOUBLEPRECISION,CHARACTER,TYPE(STRING) )</span>
<a name="ln-773"></a>   <span class="k">select type</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-774"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">integer</span><span class="p">);</span>          <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-775"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">real</span><span class="p">);</span>             <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-776"></a>   <span class="k">type is</span> <span class="p">(</span><span class="n">doubleprecision</span><span class="p">);</span>  <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="n">v2s</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-777"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">));</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="k">value</span>
<a name="ln-778"></a><span class="k">   type is</span> <span class="p">(</span><span class="n">string</span><span class="p">);</span>           <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="o">//</span><span class="k">value</span><span class="p">%</span><span class="n">str</span>
<a name="ln-779"></a>   <span class="k">end select</span>
<a name="ln-780"></a><span class="k">end function </span><span class="n">string_append_value</span>
<a name="ln-781"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-782"></a><span class="k">function </span><span class="n">string_multiply_value</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="k">value</span><span class="p">)</span> <span class="k">result</span> <span class="p">(</span><span class="n">other</span><span class="p">)</span>
<a name="ln-783"></a>
<a name="ln-784"></a><span class="c">! ident_31=&quot;@(#)M_strings::string_multiply_value(3f): multiply TYPE(STRING) value times&quot;</span>
<a name="ln-785"></a>
<a name="ln-786"></a><span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>      <span class="kd">::</span> <span class="n">self</span>
<a name="ln-787"></a><span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>                  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-788"></a><span class="k">class</span><span class="p">(</span><span class="o">*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>           <span class="kd">::</span> <span class="k">value</span>
<a name="ln-789"></a><span class="c">!  This function is primarily intended to provide behaviors for the &quot;//&quot; operator for TYPE(STRING) values</span>
<a name="ln-790"></a><span class="c">!  Notice that the value can be any of several types ( INTEGER,REAL,DOUBLEPRECISION )</span>
<a name="ln-791"></a>   <span class="k">select type</span><span class="p">(</span><span class="k">value</span><span class="p">)</span>
<a name="ln-792"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">integer</span><span class="p">);</span>          <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">repeat</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="k">value</span><span class="p">)</span>
<a name="ln-793"></a>   <span class="k">type is</span> <span class="p">(</span><span class="kt">real</span><span class="p">);</span>             <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">repeat</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="nb">nint</span><span class="p">(</span><span class="k">value</span><span class="p">))</span>
<a name="ln-794"></a>   <span class="k">type is</span> <span class="p">(</span><span class="n">doubleprecision</span><span class="p">);</span>  <span class="n">other</span><span class="p">%</span><span class="n">str</span><span class="o">=</span><span class="nb">repeat</span><span class="p">(</span><span class="n">self</span><span class="p">%</span><span class="n">str</span><span class="p">,</span><span class="nb">nint</span><span class="p">(</span><span class="k">value</span><span class="p">))</span>
<a name="ln-795"></a>   <span class="k">end select</span>
<a name="ln-796"></a><span class="k">end function </span><span class="n">string_multiply_value</span>
<a name="ln-797"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-798"></a><span class="kt">logical </span><span class="k">function </span><span class="n">eq</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">other</span><span class="p">)</span>
<a name="ln-799"></a>
<a name="ln-800"></a><span class="c">! ident_32=&quot;@(#)M_strings::eq(3f): compare derived type string objects (eq,lt,gt,le,ge,ne)&quot;</span>
<a name="ln-801"></a>
<a name="ln-802"></a>   <span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">self</span>
<a name="ln-803"></a>   <span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-804"></a>   <span class="n">eq</span><span class="o">=</span> <span class="n">self</span><span class="p">%</span><span class="n">str</span> <span class="p">.</span><span class="n">eq</span><span class="p">.</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span>
<a name="ln-805"></a><span class="k">end function </span><span class="n">eq</span>
<a name="ln-806"></a><span class="kt">logical </span><span class="k">function </span><span class="n">lt</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">other</span><span class="p">)</span>
<a name="ln-807"></a>   <span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">self</span>
<a name="ln-808"></a>   <span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-809"></a>   <span class="n">lt</span><span class="o">=</span> <span class="n">self</span><span class="p">%</span><span class="n">str</span> <span class="p">.</span><span class="n">lt</span><span class="p">.</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span>
<a name="ln-810"></a><span class="k">end function </span><span class="n">lt</span>
<a name="ln-811"></a><span class="kt">logical </span><span class="k">function </span><span class="n">gt</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">other</span><span class="p">)</span>
<a name="ln-812"></a>   <span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">self</span>
<a name="ln-813"></a>   <span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-814"></a>   <span class="n">gt</span><span class="o">=</span> <span class="n">self</span><span class="p">%</span><span class="n">str</span> <span class="p">.</span><span class="n">gt</span><span class="p">.</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span>
<a name="ln-815"></a><span class="k">end function </span><span class="n">gt</span>
<a name="ln-816"></a><span class="kt">logical </span><span class="k">function </span><span class="n">le</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">other</span><span class="p">)</span>
<a name="ln-817"></a>   <span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">self</span>
<a name="ln-818"></a>   <span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-819"></a>   <span class="n">le</span><span class="o">=</span> <span class="n">self</span><span class="p">%</span><span class="n">str</span> <span class="p">.</span><span class="n">le</span><span class="p">.</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span>
<a name="ln-820"></a><span class="k">end function </span><span class="n">le</span>
<a name="ln-821"></a><span class="kt">logical </span><span class="k">function </span><span class="n">ge</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">other</span><span class="p">)</span>
<a name="ln-822"></a>   <span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">self</span>
<a name="ln-823"></a>   <span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-824"></a>   <span class="n">ge</span><span class="o">=</span> <span class="n">self</span><span class="p">%</span><span class="n">str</span> <span class="p">.</span><span class="n">ge</span><span class="p">.</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span>
<a name="ln-825"></a><span class="k">end function </span><span class="n">ge</span>
<a name="ln-826"></a><span class="kt">logical </span><span class="k">function </span><span class="n">ne</span><span class="p">(</span><span class="n">self</span><span class="p">,</span><span class="n">other</span><span class="p">)</span>
<a name="ln-827"></a>   <span class="k">class</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span> <span class="kd">::</span> <span class="n">self</span>
<a name="ln-828"></a>   <span class="k">type</span><span class="p">(</span><span class="n">string</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">other</span>
<a name="ln-829"></a>   <span class="n">ne</span><span class="o">=</span> <span class="n">self</span><span class="p">%</span><span class="n">str</span> <span class="p">.</span><span class="n">ne</span><span class="p">.</span> <span class="n">other</span><span class="p">%</span><span class="n">str</span>
<a name="ln-830"></a><span class="k">end function </span><span class="n">ne</span>
<a name="ln-831"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-832"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-833"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-834"></a><span class="k">end module </span><span class="n">M_strings_oop</span>
<a name="ln-835"></a><span class="c">!===================================================================================================================================</span>
<a name="ln-836"></a><span class="c">!()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()!</span>
<a name="ln-837"></a><span class="c">!===================================================================================================================================</span>
</pre></div>

    </section>
    </div>
  </div>

  
    <hr>    
    </div> <!-- /container -->
    <footer>
      <div class="container">
      <div class="row">
        <div class="col-xs-6 col-md-4"><p>&copy; 2022 
                                          </p></div>
        <div class="col-xs-6 col-md-4 col-md-push-4">
          <p class="text-right">
            Documentation generated by 
            <a href="https://github.com/cmacmackin/ford">FORD</a>
             on 2022-01-16 22:32  
          </p>
        </div>
        <div class="col-xs-12 col-md-4 col-md-pull-4"><p class="text-center"> M_strings was developed by John S. Urban</p></div>
      </div>
      <br>
      </div> <!-- /container -->    
    </footer>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
    <script src="../js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../js/ie10-viewport-bug-workaround.js"></script>

    <!-- MathJax JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
        jax: ['input/TeX','input/MathML','output/HTML-CSS'],
        extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
      });
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    
    <script src="../tipuesearch/tipuesearch_content.js"></script>
    <script src="../tipuesearch/tipuesearch_set.js"></script>
    <script src="../tipuesearch/tipuesearch.js"></script>
    
    
  </body>
</html>